<?php
class HomeControl extends CommonControl{
	function idxAction(){
		$this->display('frame.main.html');
	}
	function topAction(){
		$this->out['user_name'] = $_SESSION['user']['user_name'];
		$this->display('frame.top.html');
	}
	function rightAction(){
		$this->display('frame.right.html');
	}
	function lineAction(){
		$this->display('frame.line.html');
	}
	function footAction(){
		$this->display('frame.foot.html');
	}
	function treeAction(){
		$privilege_parent = $_SESSION['privilege_parent'];
		$privilege = $_SESSION['privilege_info'];
		$data = M()->db->getRecords("select * from admin_privilege where pid=0 and id in ($privilege_parent)");
		if (!empty($data)){
			foreach($data as $k => $p){
				$menu = M()->db->getRecords("select * from admin_privilege where pid={$p['id']} and id in ($privilege)");
				$data[$k]['menus'] = $menu;
			}
		}
		$this->out['data'] = $data;
		$this->display('frame.left.html');
	}
	
	function editAction(){
		$this->display('home.edit.html');
	}
	function listAction(){
		$this->display('home.list.html');
	}
}
?>
